<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
$(function(){
	$("#saveButton").click(function(){
		var dormitory = $("#dormitory").val();
		var studentId = $("#studentId").val();
		var cnName = $("#cnName").val();
		var sex = $("#sex").combobox('getValue');
		var pnoneNumber = $("#pnoneNumber").val();
		var college = $("#college").val();
		var theClass = $("#theClass").val();
		if(dormitory!='' && studentId!='' && cnName!='' && sex!='' && pnoneNumber!='' && college!='' && theClass!=''){
			$.ajax({
				type:'POST',
				url:'dormitoryAddData.action',
				data:{dormitory:dormitory,studentId:studentId,cnName:cnName,sex:sex,pnoneNumber:pnoneNumber,college:college,theClass:theClass},
				datatype:'json',
				success:function(msg){
					if(msg.status=="200"){
						parent.closeDialog();
					}else{
						$.messager.alert("提示","保存失败");
					}
				}
			});
		}else{
			$.messager.alert("提示","请将表单填写完整");
		}
	});
});